:root {
  font-family: system-ui, 'Avenir', 'Helvetica', 'Arial', sans-serif;
  line-height: 1.5;
  font-weight: 400;

  color-scheme: light dark;
  color: rgba(255, 255, 255, 0.87);
  background-color: #242424;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  box-sizing: border-box; /* 统一盒模型 */
}

*,
*::before,
*::after {
  box-sizing: inherit; /* 确保所有元素继承 box-sizing */
}

a {
  font-weight: 500;
  color: #646cff;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #535bf2;
}

body {
  margin: 0;
  padding: 0;
  width: 100vw; /* 占满视口宽度 */
  min-height: 100vh;
  display: flex;
  flex-direction: column; /* 纵向布局，确保子元素垂直排列 */
  align-items: center;
  justify-content: center;
  overflow-x: hidden; /* 防止水平溢出 */
}

h1 {
  font-size: 3.2rem;
  line-height: 1.1;
  margin: 0 0 1rem;
  color: inherit;
}

button {
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  font-weight: 500;
  font-family: inherit;
  background-color: #1a1a1a;
  color: rgba(255, 255, 255, 0.87);
  cursor: pointer;
  transition: all 0.25s ease;
}

button:hover {
  border-color: #646cff;
  background-color: #2a2a2a;
  transform: translateY(-2px); /* 轻微上移动画 */
}

button:focus,
button:focus-visible {
  outline: 4px auto -webkit-focus-ring-color;
}

.card {
  padding: 2rem;
  background: #2a2a2a;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  width: 100%;
  max-width: 600px; /* 限制卡片最大宽度，保持美观 */
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

#app {
  width: 100vw; /* 占满屏幕宽度 */
  max-width: 100%; /* 防止溢出 */
  margin: 0;
  padding: 0 24px; /* 添加水平内边距 */
  text-align: center;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

/* 响应式设计 */
@media (max-width: 768px) {
  h1 {
    font-size: 2.5rem;
  }

  button {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  .card {
    padding: 1.5rem;
    max-width: 90vw; /* 移动端限制卡片宽度 */
  }

  #app {
    padding: 0 16px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 2rem;
  }

  button {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
  }

  .card {
    padding: 1rem;
    max-width: 95vw;
  }

  #app {
    padding: 0 12px;
  }
}

@media (prefers-color-scheme: light) {
  :root {
    color: #213547;
    background-color: #ffffff;
  }

  a:hover {
    color: #747bff;
  }

  button {
    background-color: #f9f9f9;
    color: #213547;
  }

  button:hover {
    background-color: #e0e0e0;
  }

  .card {
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    width: 100%;
  }

  .card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  }
}
